/*
*  Copyright (c) 2018. 玺得（深圳）科技有限公司.保留所有权利. http://www.pi-top.com/ 玺得（深圳）科技有限公司保留所有代码著作权.如有任何疑问请访问官方网站与我们联系. 代码只针对特定需求定制编码，不得在未经允许或授权的情况下对外传播扩散.恶意传播者，法律后果自行承担. 本代码仅用于pps-cloud系统.
*/
package com.pitop.customer.api;

import com.pitop.customer.entity.CustomerAddress;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 客户地址 api请求熔断器
 *
 * @author berton
 */
@FeignClient(value = "pps-cloud-provider", fallback = CustomerAddressFeignApiImpl.class)
public interface CustomerAddressFeignApi {
    /**
     * 查询CustomerAddress一个详情信息
     *
     * @param id
     * @param customerCode 客户编码
     * @return CustomerAddress
     */
    @GetMapping(value = "/customerAddress/load")
    CustomerAddress load(@RequestParam("id") Long id, @RequestParam("customerCode") String customerCode);


    /**
     * 根据条件id查询CustomerAddress一个详情信息
     *
     * @param id
     * @return CustomerAddress
     */
    @GetMapping(value = "/customerAddress/load/id/{id}")
    CustomerAddress loadById(@RequestParam("id") Long id);


    /**
     * 根据条件customerCode查询CustomerAddress一个详情信息
     *
     * @param customerCode 客户编码
     * @return CustomerAddress
     */
    @GetMapping(value = "/customerAddress/load/customerCode/{customerCode}")
    CustomerAddress loadByCustomerCode(@RequestParam("customerCode") String customerCode);

    /**
     * 删除CustomerAddress
     */
    @DeleteMapping("/customerAddress/delete")
    void delete(@RequestParam("id") Long id, @RequestParam("customerCode") String customerCode);


    /**
     * 查询CustomerAddress信息集合
     *
     * @return 分页对象
     */
    @PostMapping(value = "/customerAddress/list")
    List<CustomerAddress> list(@RequestBody CustomerAddress customerAddress, @RequestParam("curPage") int curPage, @RequestParam("pageSize") int pageSize);


    /**
     * 查询CustomerAddress信息集合
     *
     * @return 分页对象
     */
    @GetMapping(value = "/customerAddress/list/by")
    List<CustomerAddress> listByPk(@RequestParam("id") Long id, @RequestParam("customerCode") String customerCode, @RequestParam("curPage") int curPage, @RequestParam("pageSize") int pageSize);


    /**
     * 统计CustomerAddress信息数量根据主键
     *
     * @return 总条数
     */
    @GetMapping(value = "/customerAddress/count/by")
    Integer count(@RequestParam("id") Long id, @RequestParam("customerCode") String customerCode);

    /**
     * 统计CustomerAddress信息数量
     *
     * @return 总条数
     */
    @PostMapping(value = "/customerAddress/count")
    Integer count(@RequestBody CustomerAddress customerAddress);


    /**
     * 创建CustomerAddress
     *
     * @return CustomerAddress
     */
    @PostMapping("/customerAddress/build")
    CustomerAddress build(@RequestBody CustomerAddress customerAddress);


    /**
     * 修改CustomerAddress
     *
     * @return CustomerAddress
     */
    @PutMapping("/customerAddress/modify")
    CustomerAddress modify(@RequestBody CustomerAddress customerAddress);


}
